﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Konstaller
{
    public class Panel
    {
        //private field
        ConsoleColor back = ConsoleColor.Gray;
        ConsoleColor shad = ConsoleColor.Black;
        ConsoleColor txcolor = ConsoleColor.Black;
        string tx;
        int w = 30, h = 20;


        /// <summary>
        /// Get or Set Background Color
        /// </summary>
        public ConsoleColor BackgroundColor
        {
            get { return back; }
            set { back = value; }
        }


        /// <summary>
        /// Get or Set Shadow Color
        /// </summary>
        public ConsoleColor Shadow
        {
            get { return shad; }
            set { shad = value; }
        }


        /// <summary>
        /// Get or Set Text Color
        /// </summary>
        public ConsoleColor TextColor
        {
            get { return txcolor; }
            set { txcolor = value; }
        }


        /// <summary>
        /// Get or Set Text
        /// </summary>
        public string Text
        {
            get { return tx; }
            set { tx = value; }
        }


        /// <summary>
        /// Get or Set Height
        /// </summary>
        public int Height
        {
            get { return h; }
            set { h = value; }
        }


        /// <summary>
        /// Get or Set Width
        /// </summary>
        public int Width
        {
            get { return w; }
            set { w = value; }
        }


        /// <summary>
        /// Draw Method
        /// </summary>
        /// <param name="x">Set X Position</param>
        /// <param name="y">Set Y Position</param>
        public void Draw(int x,int y)
        {

            Console.SetCursorPosition(x, y);

            //Trance 1
            Console.BackgroundColor = BackgroundColor;
            Console.ForegroundColor = BackgroundColor;
            int px = x;
            int py = y;

            for (int j = 0; j < Height / 2; j++)
            {
                
                
                for (int i = 0; i < Width / 2; i++)
                {
                    Console.Write(" ");
                }

                             


                if (j != 0)
                {
                    Console.BackgroundColor = Shadow;
                    Console.ForegroundColor = Shadow;

                    Console.Write(" ");

                    Console.BackgroundColor = BackgroundColor;
                    Console.ForegroundColor = TextColor;
                }

               
                py++;
                Console.SetCursorPosition(px, py);

                           
            }

            Console.BackgroundColor = ConsoleColor.Blue;
            Console.ForegroundColor = ConsoleColor.Blue;
            Console.Write(" ");
            Console.BackgroundColor = Shadow;
            Console.ForegroundColor = Shadow;

            for (int i = 0; i < Width / 2; i++)
            {
                Console.Write(" ");
            }

        }

    }
}
